package abstractclass02;

public class Rect extends Shape{
    private double length;
    private double width;

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    Rect(double length, double width){
        this.length = length;
        this.width = width;
    }

    public void draw(){
        System.out.println("矩形：length = " + length + " width = " + width);
    }

    public void calcArea(){
        area = length * width;
    }
}
